<!DOCTYPE html>
<html>

<head>
  <title>Prototype</title>
</head>

<body>
  <script type="text/javascript">
    function doSomething() { }
    doSomething.prototype.foo = "bar"; // add a property onto the prototype
    var dos = new doSomething();
    dos.prop = "some value"; // add a property onto the object
    console.log(dos);


    const myDate = new Date();
    let obj = myDate;

    do {
      obj = Object.getPrototypeOf(obj);
      console.log(obj);
    } while (obj);
  </script>

</body>

</html>